<?php
/**
 * Created by PhpStorm.
 * User: hooshim
 * Date: 2014-12-05
 * Time: 오전 5:26
 */
header("Content-Type:text/html;charset=utf-8");
header("Cache-Control:no-cache");
header("Pragma:no-cache");

include_once ($_SERVER['DOCUMENT_ROOT']."/inc/conn.inc.php");
include_once ($_SERVER['DOCUMENT_ROOT']."/inc/function.inc.php"); ##property 파일 인크루드됨.

//## 파라미터 선언
$destZone 			= $_POST['destZone'];
$expressCd 			= $_POST['expressCd'];
$class    			= $_POST['class'];
$weightTon    		= $_POST['weightTon'];
$cargoType          = $_POST['cargoType'];

// Table 이름 선언
$tbname = "tblRateExpress";

$curDt =date("Y-m-d");

$query = "SELECT top 1 {$destZone}, weight FROM tblRateExpress A ";
$query .= "WHERE A.flag='Y' AND A.cargoType='{$cargoType}' AND A.expressClass='{$class}' AND A.weight>='{$weightTon}' AND A.expressCd='{$expressCd}' ORDER BY weight";
$logger->debug($query ."<br>[#FROM:" . $G_remote_ip."#]"); ## 쿼리 로그 작성
$result = makeJSONArray($query,$tbname);

$output = json_encode($result);
$output = urldecode($output);
echo iconvDecode($output);
//echo $output;
$logger->debug($_SESSION['BID'] ."//" .$output ."<br>[#FROM:" . $G_remote_ip."#]"); ## 결과 로그 작성